Conversation
9d60569 to
7891510
Compare
presto-main/src/main/java/io/prestosql/operator/SimplePagesIndexInterChannelComparator.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/SimplePagesIndexInterChannelComparator.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/WindowOperator.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/PagesIndex.java
Outdated
Show resolved
Hide resolved
7891510 to
b9979c3
Compare
Cherry-pick of trinodb/trino#5639 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino#5639 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino#5639 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino#5639 Co-authored-by: Jinlin Zhang <z_jinlin@yahoo.com> Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino#5639 Co-authored-by: Jinlin Zhang <z_jinlin@yahoo.com> Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino#5639 Co-authored-by: Jinlin Zhang <z_jinlin@yahoo.com> Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
| sortKeyChannelForEndComparison = Optional.of(source.getLayout().get(frame.getSortKeyCoercedForFrameEndComparison().get())); | ||
| } | ||
| if (node.getOrderingScheme().isPresent()) { | ||
| sortKeyChannel = Optional.of(sortChannels.get(0)); |
There was a problem hiding this comment.
sortChannels is a list. why using the first element only is sufficient?
or is the list known to be single element in this branch?
There was a problem hiding this comment.
sortKeyChannel and ordering are only used for window frame using RANGE PRECEDING or RANGE FOLLOWING. With such frame definition, a single sort item is required per spec, and it is guaranteed by the Analyzer.
There was a problem hiding this comment.
then the code should use getOnlyElement(sortChannels)
There was a problem hiding this comment.
That wouldn't work. In general, we can have multiple sort channels at this point. But for frame type RANGE, there is only one. We capture it here and use later only for RANGE frames.
I added a clarifying comment: #24157.
There was a problem hiding this comment.
What if it has multiple sortkeyChannel for frame type RANGE - Would we skip them ?
No description provided.